package edu.uclmgmu.bacteriosec.aspects.java.io.ObjectOutputStream;

import java.io.ObjectOutputStream;

import edu.uclmgmu.bacteriosec.aspects.common.Store;

privileged aspect ObjectOutputStream_CountCalls {

	void around(java.io.ObjectOutputStream caller, byte[] a, int b, int c) : target(caller) && args(a, b, c) &&  call(* ObjectOutputStream.write(byte[], int, int)) {
		Store.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString());
		proceed(caller, a, b, c);

	}
	
	void around(java.io.ObjectOutputStream caller, byte[] a) : target(caller) && args(a) &&  call(* ObjectOutputStream.write(byte[])) {
		Store.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString());
		proceed(caller, a);
	}

	void around(java.io.ObjectOutputStream caller, Object a) : target(caller) && args(a) &&  call(* ObjectOutputStream.writeObject(Object)) {
		Store.updateNumberOfCalls(thisJoinPointStaticPart.getSignature().toString());
		proceed(caller, a);
	}
}
